import {Injectable, Injector} from '@angular/core';
import {Constant} from '@core/constant';
import {_HttpClient, SettingsService} from '@delon/theme';
import {MyHttpClient} from '../MyHttpClient';

@Injectable()
export class csListService {
  get cnt(): Constant {
    return this.injector.get(Constant);
  }

  constructor(
    private injector: Injector,
    private http: _HttpClient,
    private myHttp: MyHttpClient,
    public setting: SettingsService,
  ) {
  }

  /**
   * 分页获取商品
   */
  list(): string {
    return `${this.cnt.baseUrl}/rest/fxjdhData01Controller/list/` + this.setting.user.username;
  }
  getList() {
    return this.http.get(`${this.cnt.baseUrl}/rest/fxjdhData01Controller/list/` + this.setting.user.username);
  }

  //本月回款总额  /rest/dhbi/getbyhkze/
  getbyhkze() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getbyhkze/` + this.setting.user.username);
  }
  // 当前案件逾期总额  /rest/dhbi/getdqajyqze/
  getdqajyqze() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getdqajyqze/` + this.setting.user.username);
  }
  // 本月逾期总额 /rest/dhbi/getbyyqze/wwq
  getbyyqze() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getbyyqze/` + this.setting.user.username);
  }
  // 当前待催收笔数  /rest/dhbi/getdqdcsbs/
  getdqdcsbs() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getdqdcsbs/` + this.setting.user.username);
  }
  // 当前待催收本金 /rest/dhbi/getdqdcsbj/
  getdqdcsbj() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getdqdcsbj/` + this.setting.user.username);
  }
  // 当前待催收利息 /rest/dhbi/getdqdcslx/
  getdqdcslx() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getdqdcslx/` + this.setting.user.username);
  }
  // 本月赔付笔数 /rest/dhbi/getyjpfbsbyx/
  getyjpfbsbyx() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getyjpfbsbyx/` + this.setting.user.username);
  }
  // 本月赔付金额 /rest/dhbi/getyjpfjeby/
  getyjpfjeby() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getyjpfjeby/` + this.setting.user.username);
  }
  // 历史赔付笔数 /rest/dhbi/getlspfbs/
  getlspfbs() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getlspfbs/` + this.setting.user.username);
  }
  // 历史赔付金额 /rest/dhbi/getlspfje/wwq
  getlspfje() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getlspfje/` + this.setting.user.username);
  }
  // 今日回款笔数 /rest/dhbi/getjrhkbs/
  getjrhkbs() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getjrhkbs/` + this.setting.user.username);
  }
  // 今日回款金额 /rest/dhbi/getjrhkje/
  getjrhkje() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getjrhkje/` + this.setting.user.username);
  }
  // MOB分类 /rest/dhbi/getmobfl/admin?pageNumber=1&pageSize=10 
  getmobfl() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getmobfl/` + this.setting.user.username + '?pageNumber=1&pageSize=10');
  }
  // 催收排行榜 /rest/dhbi/getcsph/admin?pageNumber=1&pageSize=10
  getcsph() {
    return this.http.get(`${this.cnt.baseUrl}/rest/dhbi/getcsph/` + this.setting.user.username + '?pageNumber=1&pageSize=10');
  }
  /**
   * 获取产品
   * @param id
   */
  getprodetail(productId) {
    return this.http.get(
      `${this.cnt.baseUrl}/rest/fxjOrderMainController/${productId}`,
      // `${this.cnt.baseUrl}/rest/fxjPlReplanController/${id}`,
    );
  }

  // getProduct(productId) {
  //   return this.http.get(
  //     `${this.cnt.baseUrl}/rest/fxjOrderMainController/${productId}`,
  //   );
  // }


  /**
   * 获取贷款信息
   * @param id
   */
  getLoanInfo(id) {
    return this.http.get(
      `${this.cnt.baseUrl}/rest/fxjLoanFkController/` + id,
    );
  }

  /**
   * 修改产品
   * @param product
   */
  editPro(product) {
    return this.http.put(
      `${this.cnt.baseUrl}/rest/fxjPaMainController/${product.id}`,
      product,
    );
  }


  uploadcarinfo(): string {
    return `${this.cnt.baseUrl}/rest/fxjDhImpController/uploadexcel?username=` + this.setting.user.username;
  }


  getpostasklistall() {

    return `${this.cnt.baseUrl}/rest/posXjtaskController/list/` + this.setting.user.username;


  }

  getposfilelist(id) {
    return this.http.get(`${this.cnt.baseUrl}/rest/posXjtaskController/filelist/` + id);
  }


}